// license-header java merge-point
/**
 * This is only generated once! It will never be overwritten.
 * You can (and have to!) safely modify it by hand.
 */
package org.tinaelle.server.domain;
/**
 * @see org.tinaelle.server.domain.AdReference
 */
public class AdReferenceDaoImpl
    extends org.tinaelle.server.domain.AdReferenceDaoBase
{
    /**
     * @see org.tinaelle.server.domain.AdReferenceDao#toAdReferenceDTO(org.tinaelle.server.domain.AdReference)
     */
    public org.tinaelle.common.dto.AdReferenceDTO toAdReferenceDTO(final org.tinaelle.server.domain.AdReference entity)
    {
        return super.toAdReferenceDTO(entity);
    }

    /**
     * Retrieves the entity object that is associated with the specified value object
     * from the object store. If no such entity object exists in the object store,
     * a new, blank entity is created
     */
    private org.tinaelle.server.domain.AdReference loadAdReferenceFromAdReferenceDTO(org.tinaelle.common.dto.AdReferenceDTO adReferenceDTO)
    {
        org.tinaelle.server.domain.AdReference adReference = this.load(adReferenceDTO.getAdReferenceId());
        if (adReference == null)
        {
            adReference = org.tinaelle.server.domain.AdReference.Factory.newInstance();
        }
        return adReference;
    }

    
    /**
     * @see org.tinaelle.server.domain.AdReferenceDao#adReferenceDTOToEntity(org.tinaelle.common.dto.AdReferenceDTO)
     */
    public org.tinaelle.server.domain.AdReference adReferenceDTOToEntity(org.tinaelle.common.dto.AdReferenceDTO adReferenceDTO)
    {
        org.tinaelle.server.domain.AdReference entity = this.loadAdReferenceFromAdReferenceDTO(adReferenceDTO);
        this.adReferenceDTOToEntity(adReferenceDTO, entity, true);
        return entity;
    }
}